package com.star.spring.aop.service;

import com.star.spring.aop.invocation.MyInvocationHandler;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @ClassName InvocationTest
 * @Author star
 * @Date 2024/10/18 11:24
 */
@Service
public class InvocationTestService {

    @Autowired
    private MyInvocationHandler myinvocationHandler;

    public Integer testAdd() {

        CalculateServiceImpl calculateServiceImpl = new CalculateServiceImpl();

        CalculateService calculateService = (CalculateService) myinvocationHandler.bind(calculateServiceImpl);
        int add = calculateService.add(1, 2);
        return add;
    }
}
